enum TOKEN_TYPE{
    TOKEN_EOF,
    TOKEN_ID,
    TOKEN_NUM,
    TOKEN_IF,
    TOKEN_ELSE,
    TOKEN_SWITCH,
    TOKEN_CASE,
    TOKEN_DEFAULT,
    TOKEN_INT,
    TOKEN_VOID,
    TOKEN_STRUCT,
    TOKEN_RETURN,
    TOKEN_BREAK,
    TOKEN_GOTO,
    TOKEN_WHILE,
    TOKEN_FOR,
    TOKEN_ADD,
    TOKEN_MINUS,
    TOKEN_STAR,
    TOKEN_DIV,
    TOKEN_GREAT,
    TOKEN_GREAT_EQUAL,
    TOKEN_LESS,
    TOKEN_LESS_EQUAL,
    TOKEN_EQUAL,
    TOKEN_NOT,
    TOKEN_NOT_EQUAL,
    TOKEN_ASSIGN,
    TOKEN_COMMA,
    TOKEN_DOT,
    TOKEN_SEMICOLON,
    TOKEN_LEFT_BRACE,
    TOKEN_RIGHT_BRACE,
    TOKEN_LEFT_SBRACE,
    TOKEN_RIGHT_SBRACE,
    TOKEN_LEFT_CBRACE,
    TOKEN_RIGHT_CBRACE,
    TOKEN_UNKOWN
};


typedef struct token_{
    int type;
    union token_lexeme{
        char * letter;
        int digit;
    }lexeme;
}token_;

typedef token_ * token;

token init_token(int type,char * letter,int digit);
char * token_letter(token t);
int token_digit(token t);
void log_token(token t);

#define set_token_type(t,x) (t->type=(x))
#define set_token_digit(t,x) (t->lexeme.digit=(x))
#define set_token_letter(t,x) (t->lexeme.letter=(x))
#define token_type(t) (t->type)

